<template>
  <div class="common-card">
    <div class="common-card-left" :style="backcolor">
      <div class="image">
        <slot name="commonImage"></slot>
      </div>
    </div>
    <div class="common-card-right">
      <div class="meta">
        <div class="card-main">{{ title }}：{{ content }}</div>
        <div class="card-others">
          <slot name="commonOthers"></slot>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  name: "CommonCard",
  props: {
    title: {
      type: String,
      default: ''
    },
    content: {
      default: ''
    },
    loading: {
      type: Boolean,
      default: false
    },
    bgcolor: {
      type: String,
      default: '#fff'
    }
  },
  data () {
    return {
    };
  },
  computed: {
    backcolor(){
      return {"background": this.bgcolor}
    }
  }
}
</script>
<style lang="less" scoped>
  .common-card {
    height: 125px;
    width: 100%;
    cursor: pointer;
    padding-bottom: 10px;
    display: flex;
    justify-content: flex-start;
    .common-card-left {
      width: 40%;
      padding-top: 10px;
      // background: chocolate;
      .image {
        vertical-align: middle;
      }
    }
    .common-card-right {
      padding-top: 8px;
      flex: 1;
      background: #fff;
      .meta {
        margin-left: 4px;
        .card-main {
          overflow: hidden;
          text-overflow: ellipsis;
          word-break: break-all;
          white-space: nowrap;
          color: #000;
          margin-top: 10px;
          margin-bottom: 10px;
          font-size: 20px;
          line-height: 38px;
          height: 38px;
        }
        .card-others {
          color: rgba(0, 0, 0, .45);
          font-size: 14px;
          line-height: 22px;
        }
      }
    }
  }
</style>